Skip to content

[Memory64] pthread libc changes for 64-bit - #15229

Merged
aardappel merged 1 commit into
emscripten-core:mainfrom
aardappel:b12
Oct 8, 2021
Merged

[Memory64] pthread libc changes for 64-bit#15229
aardappel merged 1 commit into
emscripten-core:mainfrom
aardappel:b12

Conversation

@aardappel

Copy link
Copy Markdown
Collaborator

No description provided.

@aardappel
aardappel requested a review from kripken October 4, 2021 23:37
case EM_PROXIED_JS_FUNCTION:
q->returnValue.d =
emscripten_receive_on_main_thread_js((int)q->functionPtr, q->args[0].i, &q->args[1].d);
emscripten_receive_on_main_thread_js((int)(size_t)q->functionPtr, q->args[0].i, &q->args[1].d);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intptr_t there to avoid the double cast?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 64-bit, intptr_t would cast from 64 to 64, so would still need a secondary cast?

Comment thread system/lib/pthread/library_pthread_stub.c Outdated
Comment thread system/lib/pthread/library_pthread.c Outdated
volatile int __vi[10];
unsigned __s[10];
} __u;
#ifdef __EMSCRIPTEN__

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the 11 change to 10?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the 11 field is the pointer below.


#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the new constants 14 and 7? I can't see how doubling a pointer size leads to such things, so I'm missing something...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aardappel

Copy link
Copy Markdown
Collaborator Author

This now contains a small JS change from #15222 because they can't work independently

@aardappel
aardappel enabled auto-merge (squash) October 7, 2021 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants